﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Transactions {
    import Engine.Managers.*;
    import Classes.orders.*;

    public class TGetOrders extends TFarmTransaction {

        private var m_message:String;

        public function TGetOrders(_arg1:String=null){
            this.m_message = _arg1;
        }
        override public function perform():void{
            signedCall("UserService.getOrders");
        }
        override protected function onComplete(_arg1:Object):void{
            var _local2:int;
            var _local3:String;
            var _local4:int;
            if (_arg1){
                _local2 = 0;
                for (_local3 in _arg1) {
                    switch (_local3){
                        case OrderType.VISITOR_HELP:
                            _local4 = Global.world.orderMgr.addOrdersByType(_local3, _arg1);
                            if (_local4 > 0){
                                _local2 = (_local2 + _local4);
                                StatsManager.count("zoom", "show", "neighbor_order");
                                Global.world.citySim.friendVisitManager.setNeedToCheckQueue();
                            };
                            break;
                    };
                };
                if (((this.m_message) && ((_local2 > 0)))){
                    Global.ui.showTickerMessage(this.m_message);
                };
            };
        }

    }
}//package Transactions 
